package org.yang.novel.wx.controller;

import org.yang.common.Msg;
import org.yang.novel.wx.entity.Bookrack;
import org.yang.novel.wx.service.BookrackService;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;

import javax.annotation.Resource;
/**
 * 书架控制器
 * @author shichenyang
 * @email gyv12345@163.com
 * @date 2019/01/07
 */
@RestController
@RequestMapping("/bookrack")
public class BookrackController {
    @Resource
    private BookrackService bookrackService;

    @GetMapping("/getBookracks")
    public PageInfo getBookracks(Bookrack bookrack,Integer page,Integer limit){
        return bookrackService.getBookracks(bookrack,page,limit);
    }
    @PostMapping("/addBookrack")
    public Msg addBookrack(Bookrack bookrack){
        return bookrackService.addBookrack(bookrack);
    }

    @PutMapping("/updateBookrack")
    public Msg updateBookrack(Bookrack bookrack){
        return bookrackService.updateBookrack(bookrack);
    }

    @DeleteMapping("/delBookrack")
    public Msg delBookrack(Bookrack bookrack){
        return bookrackService.delBookrack(bookrack);
    }
}
